<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <body>

        <ui:composition template="./../../Template/generalTemplate.xhtml">

            <ui:define name="content">

                <h:form id="form2">
                    <f:view beforePhase="#{editFinalGoodInventoryLevelManagedBean.iniView}">
                        <p:panel id="rawMaterial" header="Edit Final Good Inventory Level" style="height:495px;">
                            <div style="margin-top:20px;margin-left: 130px;">
                                <h:panelGrid id="editInventoryLevel">

                                    <p:growl id="growl" showDetail="true" />
                                    <p:dataTable id="editInventoryLevel2"  emptyMessage="No Item to display" value="#{editFinalGoodInventoryLevelManagedBean.inventoryList}" var ="inventoryList" paginator="true" rows="6">
                                        <p:column>
                                            <f:facet name="header">Product Name</f:facet>
                                            #{inventoryList.product.productName}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Incoming Quantity (editable)</f:facet>
                                            <p:inplace editor="true" onEditUpdate="editInventoryLevel2">
                                                <p:inputText value="#{inventoryList.incomingQty}"/>
                                            </p:inplace>
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Current Inventory Level</f:facet>
                                            #{inventoryList.currentLevel}
                                        </p:column>

                                        <p:column>
                                            <f:facet name="header">Reserved Quantity</f:facet>
                                            #{inventoryList.reservedQty}
                                        </p:column>
                                    </p:dataTable>
                                    <br />
                                    <p:commandButton value="Update "  update=":form2:editInventoryLevel growl" ajax="false" actionListener="#{editFinalGoodInventoryLevelManagedBean.edit}"/>

                                </h:panelGrid>
                            </div>  
                        </p:panel>
                    </f:view>
                </h:form>

            </ui:define>


        </ui:composition>

    </body>
</html>

